package com.example.lzh.controller;

import com.example.lzh.component.DocSearch;
import com.example.lzh.component.Index;
import com.example.lzh.component.Parser;
import com.example.lzh.model.DocInfo;
import com.example.lzh.model.Result;
import com.example.lzh.model.Weight;
import org.ansj.domain.Term;
import org.ansj.splitWord.analysis.ToAnalysis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;

/**
 * @Question DocSearchController
 * @Date 2023/1/28 19:08
 * @Solution
 */
@RestController
public class DocSearchController {
    @Autowired
    DocSearch search;
    @RequestMapping("/search")
    public List<Result> searchInverted(String str) throws InterruptedException {
        List<Result> result=search.searchInverted(str);
        return result;
    }
}
